package com.example.demo.feigns;

import com.example.demo.config.FeignConfig;
import com.example.demo.domain.UserInfo;
import com.example.demo.feigns.fallback.UserFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "user", fallback = UserFeignFallback.class, configuration = FeignConfig.class)
public interface UserFeign {

    @GetMapping("/user/info/{id}")
    public UserInfo getUserInfo(@PathVariable("id") String id);

    @PostMapping("/user/update")
    public void updateUserInfo(@RequestBody UserInfo userInfo);
}
